<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
session_start(); //we need to call PHP's session object to access it through CI
class Home extends CI_Controller {
	function __construct() 	// site classı her çağrıldığında otomatik çalışan fonksiyon
	{
		parent::__construct ();
		if ($this->session->userdata ( 'logged_in' )) {
			$session_data = $this->session->userdata ( 'logged_in' );
				
		} else {
			redirect ( 'Main_page', 'refresh' );
		}
	}


	 function index()
	 {
	
	     $session_data = $this->session->userdata('logged_in');
	     $data['username'] = $session_data['user_mail'];
	     
	     $data['baslik'] = "Dashboard";
	     $data['content'] ='user/content';
	     $this->load->view('user/anasayfa',$data);
	     
	
	
	 }
	 
	 function sinav_goster(){
	 	$data['baslik'] = "Sinav Ekranı";
	 	$data['content'] ='user/exam_view';
	 	$this->load->view('user/anasayfa',$data);
	 	
	 }
	


}

?>
